Skip to content

codecov: fix ~/.gitconfig lock race on self-hosted runners (disable_safe_directory)#92

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:codecov-safe-directory-race
Jun 14, 2026
Merged

codecov: fix ~/.gitconfig lock race on self-hosted runners (disable_safe_directory)#92
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:codecov-safe-directory-race

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown

Problem (root cause, verified)

codecov/codecov-action@v7's internal Set safe directory step runs git config --global --add safe.directory ..., which takes a lock on ~/.gitconfig. The SciML self-hosted demeter runners share a single home directory (/home/chrisrackauckas) across many concurrent jobs, so those git config --global calls race for the same lockfile:

error: could not lock config file /home/chrisrackauckas/.gitconfig: File exists

The action then exits 255 and fails the job after the tests already passed. fail_ci_if_error: false does not help here because the failure happens in a pre-upload setup step, not in the upload itself. 100% of observed codecov job failures were on demeter; 0% on GitHub-hosted/ephemeral runners.

Fix

On every codecov/codecov-action@v7 step in the repo:

  • disable_safe_directory: true — skips the racing git config --global call entirely. This is a real input of codecov-action (added in v5+; present in v7). Harmless on hosted runners since the checkout dir is already trusted there.
  • continue-on-error: true on the step — so any future codecov setup-step non-zero exit can never fail an otherwise-green job.
  • fail_ci_if_error: false set explicitly in with: for clarity/defense-in-depth.

Files touched

  • .github/workflows/tests.yml (codecov step)
  • .github/workflows/documentation.yml (codecov step)
  • .github/workflows/downstream.yml (codecov step)

actionlint clean.

NOTE: v1 must be retagged after merge for @v1 callers. Ignore until reviewed by @ChrisRackauckas.

… lock race on shared-home self-hosted runners)

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas marked this pull request as ready for review June 14, 2026 09:34
@ChrisRackauckas ChrisRackauckas merged commit 63c3dc0 into SciML:master Jun 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants